package com.dce.dev.api.common.tools;

import java.io.FileInputStream;

import org.springframework.util.ResourceUtils;

public class JsonFileTool {
    /**
     * 读取JSON文件
     */
    public static String readJSON(String strFileName) {
        String strResult = "";
        try {
        	
        	FileInputStream is = new FileInputStream(ResourceUtils.getFile("classpath:json/"+strFileName));
            int size = is.available();
            byte[] buffer = new byte[size];
            is.read(buffer);
            is.close();
            strResult = new String(buffer, "UTF-8");
            System.out.println(strResult);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return strResult;
    }
}
